export default class Download {
  constructor(url) {
    this.dom = document.createElement('a')
    this.dom.style.display = 'none'
    this.dom.setAttribute('href', url)
    this.dom.setAttribute('download', true)
    this.dom.setAttribute('target', '_blank')
    document.body.appendChild(this.dom)
    this.dom.click()
  }
  destory() {
    document.body.removeChild(this.dom)
  }
}
